import React, { Component } from 'react';
import { Text, View } from 'react-native';

/**
 * 自定义组件
 */
class Greeting extends  Component {
    render() {
        return (
            <Text>Hello {this.props.name}</Text>
        );
    }
}

/**
 * 使用自定义组件
 */
export default class LotsOfGreetings extends Component {
    render() {
        return (
            <View style={{alignItems: 'center'}}>
                <Greeting name='mazaiting'/>
                <Greeting name='mazaiting123'/>
                <Greeting name='mazaiting456'/>
            </View>
        );
    }
}